<template>
	<view class="" style="width: 100vw;height: 100vh">
		<view class="" :style="{'background':kbackgroundColor2}" style="min-height: 100vh">
			<hx-navbar title="我的认证" :back="true" :fixed="false" :color="knavTitleColor" barPlaceholder="hidden"
				transparent="auto">
			</hx-navbar>
			<view class="content-top">
				<view class="content" :style="{'background':ktabbarBgColor,'color':knormalColor}">
					<view class="top" v-for="(item,index) in type_list"
						:class="(index==0 ? 'item-border':'item-border-none')" @click="toAuth(item)">
						<view class="top_left">{{item.name}}</view>
						<view class="top_right">
							<uni-icons type="right" :color="knormalColor" size="20"></uni-icons>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type_list: [{
					id: 1,
					name: '个人认证',
				}, {
					id: 2,
					name: '企业认证',
				}],
				type_index: 0,
			}
		},
		onLoad() {},
		onShow() {},
		computed: {},
		methods: {
			toAuth(item) {
				console.log("item--", item);
				if (item.id == 1) {
					uni.navigateTo({
						url: '/pages/user/apply/apply'
					})

				} else {
					this.$api.getPurseEnte(res => {
						console.log("res--",res);
						if (res.status) {
							if (res.data.data == null || res.data.data == '') {
								uni.navigateTo({
									url: '/pages/user/wallet/company-auth'
								})
								console.log("res-1-",res);
							} else {
								uni.navigateTo({
									url: '/pages/user/wallet_system/attestation?type=' + res.data.data.status
								})
								console.log("res-2-",res);
							}
						} else {
							this.$common.errorToShow(res.message)
						}
					})
				}

			},
		},
	}
</script>

<style lang="scss" scoped>
	.body {
		width: 100vw;
		height: 100vh;
	}

	.content-top {
		position: relative;
		width: 100%;
		padding: 30rpx 30rpx 0 30rpx;
	}

	.content {
		border-radius: 20rpx;

		.item-border {
			border-bottom: 2rpx solid #535353;
		}

		.item-border-none {
			border-bottom: 0rpx solid #535353;
		}

		.top {
			display: flex;
			justify-content: space-between;
			padding: 30rpx 0;
			margin: 0 35rpx;

			.top_left {
				font-size: 28rpx;
			}

			.top_right {
				display: flex;
				flex-direction: row;

				.right_title {
					font-size: 28rpx;
				}
			}
		}
	}

	.box_footer {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-left: 10rpx;
		font-size: 24rpx;
		height: 93rpx;
		border-top: 1rpx solid #898989;
		margin-top: 10rpx;
		color: #8E8E8E;
	}

	.bottom_box {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		bottom: 100rpx;
		width: 100%;

		.submit_btn {
			width: 280rpx;
			height: 88rpx;
			line-height: 88rpx;
			color: white;
			text-align: center;
			border-radius: 50rpx;
		}

		.submit_btn2 {
			width: 280rpx;
			height: 88rpx;
			border: 1rpx solid #d9d9d9;
			color: #999;
			line-height: 88rpx;
			text-align: center;
			border-radius: 50rpx;
		}
	}
</style>